/*
 * @Description: 
 * @Author: mmzhang
 * @Date: 2021-12-15 09:37:47
 * @LastEditTime: 2022-11-10 10:47:09
 */
import ruleOpt from '@/biz/option/rule.js'
import Opt from '@/components/dt/info/Opt.js'
import ProBuildUnit from '@/biz/option/proBuildUnit.js'

let _this = null
let proBuildUnit = new ProBuildUnit()
class SearchOpt extends Opt {

  constructor(vm) {
    _this = vm
    super()
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }


  createAll() {
    this.all = [
      {
        title: '退购状态',
        key: 'status',
        placeholder: '请选择',
        select: {
          key: 'backStatus',
        },
      },
      {
        title: '退购单编号',
        key: 'backCode',
        placeholder: '请输入至少4位退购单编号',
        input: {},
        rules: [
          ruleOpt.check('请输入至少4位退购单编号', (value) => {
            return value && value.length < 4
          })
        ]
      },
      {
        title: '认购单编号',
        key: 'orderCode',
        placeholder: '请输入至少4位认购单编号',
        input: {},
        rules: [
          ruleOpt.check('请输入至少4位认购单编号', (value) => {
            return value && value.length < 4
          })
        ]
      },
      ...proBuildUnit.options(_this, false, false),
      // {
      //   title: '所属房源',
      //   key: 'roomCode',
      //   placeholder: '请输入房源名称',
      //   input: {}
      // }
    ]
  }
}

export default SearchOpt